﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Reflection;

namespace SharpMUSH
{
    public static class Config_Old
    {
        #region Default Config Options
        static public Dictionary<string, string> Default = new Dictionary<string, string>()
        {
            {"MUD_NAME","Sharp MUSH"},
            {"MUD_URL", ""},
            {"PORT", "4000"},
            {"IP_ADDR", ""},
            {"USE_DNS", "yes"},
            {"INPUT_DATABASE","data/indb"},
            {"OUTPUT_DATABASE","data/outdb"},
            {"CRASH_DATABASE","data/crash"},
            {"MAIL_DATABASE","data/maildb"},
            {"CHAT_DATABASE","data/chatdb"},
            {"PLAYER_START","0"},
            {"MASTER_ROOM","2"},
            {"BASE_ROOM","0"},
            {"ANCESTOR_ROOM","-1"},
            {"ANCESTOR_EXIT","-1"},
            {"ANCESTOR_THING","-1"},
            {"ANCESTOR_PLAYER","-1"},
            {"DEFAULT_HOME","0"},
            {"ACCESS_FILE","access.cnf"},
            {"NAMES_FILE","names.cnf"},
            {"MONEY_SINGULAR","Token"},
            {"MONEY_PLURAL","Tokens"},
            {"IDLE_TIMEOUT","0m"},
            {"UNCONNECTED_IDLE_TIMEOUT","5m"},
            {"KEEPALIVE_TIMEOUT","5m"},
            {"MAX_LOGINS","120"},
            {"GUEST_DBREF",""},
            {"STARTING_MONEY","150"},
            {"PAYCHECK","50"},
            {"STARTING_QUOTA","20"},
            {"PLAYER_QUEUE_LIMIT","100"},
            {"QUEUE_CHUNK","3"},
            {"ACTIVE_QUEUE_CHUNK","1"},
            {"FUNCTION_RECURSION_LIMIT","50"},
            {"FUNCTION_INVOCATION_LIMIT","50"},
            {"MAX_PLAYER_CHANS","0"},
            {"MAX_PARENTS","10"},
            {"MAX_DEPTH","10"},
            {"CHAN_COST","1000"},
            {"WHISPER_LOUDNESS","100"},
            {"MAX_DBREF","0"},
            {"MAX_ATTRS_PER_OBJ","2048"},
            {"MAIL_LIMIT","300"},
            {"KILL_MIN_COST","10"},
            {"KILL_DEFAULT_COST","10"},
            {"KILL_BONUS","50"},
            {"FIND_COST","100"},
            {"QUOTA_COST","1"},
            {"QUEUE_COST","10"},
            {"QUEUE_LOSS","63"},
            {"ROOM_COST","10"},
            {"OBJECT_COST","10"},
            {"LINK_COST","1"},
            {"EXIT_COST","1"},
            {"PURGE_INTERVAL","10m1s"},
            {"DBCK_INTERVAL","9m59s"},
            {"WARN_INTERVAL","1h"},
            {"FLOAT_PRECISION","6"},
            {"LOG_WIPE_PASSWD","stab!"},
            {"PLAYER_NAME_LEN","16"},
            {"MAX_ALIASES","3"},
            {"USE_QUOTA","yes"},
            {"DUMP_INTERVAL","1h"},
            {"FORKING_DUMP","yes"},
            {"DUMP_WARNING_5MIN","GAME: Database save in 5 minutes."},
            {"DUMP_WARNING_1MIN","GAME: Database save in 1 minute."},
            {"DUMP_MESSAGE","GAME: Saving Databases. Game may freeze for a moment."},
            {"DUMP_COMPLETE","GAME: Save Complete."},
            {"CONNECT_FILE","txt/connect.txt"},
            {"MOTD_FILE","txt/motd.txt"},
            {"WIZMOTD_FILE","txt/wizmotd"},
            {"QUIT_FILE","txt/quit.txt"},
            {"NEWUSER_FILE","txt/newuser.txt"},
            {"DOWN_FILE","txt/down.txt"},
            {"REGISTER_CREATE_FILE","txt/register.txt"},
            {"GUEST_FILE","txt/guest.txt"},
            {"FULL_FILE","txt/full.txt"},
            {"ERROR_LOG","log/netmush.log"},
            {"CONNECT_LOG","log/connect.log"},
            {"WIZARD_LOG","log/wizard.log"},
            {"CHECKPT_LOG","log/checkpt.log"},
            {"TRACE_LOG","log/trace.log"},
            {"COMMAND_LOG","log/command.log"},
            {"LOG_COMMANDS","no"},
            {"LOG_FORCES","yes"},
            {"LOGINS","yes"},
            {"GUESTS","yes"},
            {"PLAYER_CREATION","yes"},
            {"REVERSE_SHS","yes"},
            {"ROOM_CONNECTS","yes"},
            {"SAFER_UFUN","yes"},
            {"FUNCTION_SIDE_EFFECTS","yes"},
            {"NOISY_WHISPER","no"},
            {"NOISY_CEMIT","no"},
            {"POSSESSIVE_GET","yes"},
            {"POSSESSIVE_GET_D","no"},
            {"REALLY_SAFE","yes"},
            {"ZONE_CONTROL_ZMP_ONLY","yes"},
            {"DESTROY_POSSESSIONS","yes"},
            {"LINK_TO_OBJECT","yes"},
            {"OWNER_QUEUES","no"},
            {"WIZ_NOAENTER","no"},
            {"FULL_INVIS","no"},
            {"EMPTY_ATTRS","yes"},
            {"ADESTROY","no"},
            {"AMAIL","no"},
            {"PLAYER_LISTEN","yes"},
            {"PLAYER_AHEAR","yes"},
            {"STARTUPS","yes"},
            {"READ_REMOTE_DESC","no"},
            {"ANSI_NAME","yes"},
            {"COMMA_EXIT_LIST","yes"},
            {"COUNT_ALL","no"},
            {"EXITS_CONNECT_ROOMS","no"},
            {"WIZWALL_PREFIX","Broadcast:"},
            {"RWALL_PREFIX","Admin:"},
            {"WALL_PREFIX","Announcement:"},
            {"ANNOUNCE_CONNECTS","yes"},
            {"PLAYER_NAME_SPACES","no"},
            {"FLAGS_ON_EXAMINE","yes"},
            {"EX_PUBLIC_ATTRIBS","yes"},
            {"BLIND_PAGE","no"},
            {"PAGE_ALIASES","no"},
            {"CHAT_STRIP_QUOTE","yes"},
            {"NEWLINE_ONE_CHAR","yes"},
            {"ONLY_ASCII_IN_NAMES","yes"},
            {"EXIT_FLAGS",""},
            {"ROOM_FLAGS",""},
            {"PLAYER_FLAGS","enter_ok inherit no_command ansi"},
            {"THING_FLAGS","no_command"},
            {"CHANNEL_FLAGS","player"}
        };

        #endregion

        // All the variables from our "mush.cnf" file.  Please reference
        // That file for meanings of the various options.
        #region Essentials
        static public string MUD_NAME;
        static public string MUD_URL;
        static public int PORT;
        static public string IP_ADDR;
        static public bool USE_DNS;
        static public string INPUT_DATABASE;
        static public string OUTPUT_DATABASE;
        static public string CRASH_DATABASE;
        static public string MAIL_DATABASE;
        static public string CHAT_DATABASE;
        static public int PLAYER_START;
        static public int MASTER_ROOM;
        static public int BASE_ROOM;
        static public int ANCESTOR_ROOM;
        static public int ANCESTOR_EXIT;
        static public int ANCESTOR_THING;
        static public int ANCESTOR_PLAYER;
        static public int DEFAULT_HOME;
        static public string ACCESS_FILE;
        static public string NAMES_FILE;
        #endregion

        #region Limits, Costs and Others
        static public string MONEY_SINGULAR;
        static public string MONEY_PLURAL;
        static public TimeSpan IDLE_TIMEOUT;
        static public TimeSpan UNCONNECTED_IDLE_TIMEOUT;
        static public TimeSpan KEEPALIVE_TIMEOUT;
        static public int MAX_LOGINS;
        static public int GUEST_DBREF;
        static public int STARTING_MONEY;
        static public int PAYCHECK;
        static public int STARTING_QUOTA;
        static public int PLAYER_QUEUE_LIMIT;
        static public int QUEUE_CHUNK;
        static public int ACTIVE_QUEUE_CHUNK;
        static public int FUNCTION_RECURSION_LIMIT;
        static public int FUNCTION_INVOCATION_LIMIT;
        static public int MAX_PLAYER_CHANS;
        static public int MAX_PARENTS;
        static public int MAX_DEPTH;
        static public int CHAN_COST;
        static public int WHISPER_LOUDNESS;
        static public int MAX_DBREF;
        static public int MAX_ATTRS_PER_OBJ;
        static public int MAIL_LIMIT;
        static public int KILL_MIN_COST;
        static public int KILL_DEFAULT_COST;
        static public int KILL_BONUS;
        static public int FIND_COST;
        static public int QUOTA_COST;
        static public int QUEUE_COST;
        static public int QUEUE_LOSS;
        static public int ROOM_COST;
        static public int LINK_COST;
        static public int OBJECT_COST;
        static public int EXIT_COST;
        static public TimeSpan PURGE_INTERVAL;
        static public TimeSpan DBCK_INTERVAL;
        static public TimeSpan WARN_INTERVAL;
        static public int FLOAT_PRECISION;
        static public string LOG_WIPE_PASSWD;
        static public int PLAYER_NAME_LEN;
        static public int MAX_ALIASES;
        static public bool USE_QUOTA;
        #endregion

        #region Dump Stuff
        static public TimeSpan DUMP_INTERVAL;
        static public bool FORKING_DUMP;
        static public string DUMP_WARNING_5MIN;
        static public string DUMP_WARNING_1MIN;
        static public string DUMP_MESSAGE;
        static public string DUMP_COMPLETE;
        #endregion

        #region Filenames
        static public string CONNECT_FILE;
        static public string MOTD_FILE;
        static public string WIZMOTD_FILE;
        static public string QUIT_FILE;
        static public string NEWUSER_FILE;
        static public string DOWN_FILE;
        static public string REGISTER_CREATE_FILE;
        static public string GUEST_FILE;
        static public string FULL_FILE;
        static public Dictionary<string, string> HELP_COMMANDS = new Dictionary<string, string>();
        #endregion

        #region Logging
        static public string ERROR_LOG;
        static public string CONNECT_LOG;
        static public string WIZARD_LOG;
        static public string CHECKPT_LOG;
        static public string TRACE_LOG;
        static public string COMMAND_LOG;
        static public bool LOG_COMMANDS;
        static public bool LOG_FORCES;
        #endregion

        #region Logins
        static public bool LOGINS;
        static public bool GUESTS;
        static public bool PLAYER_CREATION;
        static public bool REVERSE_SHS;
        static public bool ROOM_CONNECTS;
        #endregion

        #region Options affecting commands and functions
        static public bool SAFER_UFUN;
        static public bool FUNCTION_SIDE_EFFECTS;
        static public bool NOISY_WHISPER;
        static public bool NOISY_CEMIT;
        static public bool POSSESSIVE_GET;
        static public bool POSSESSIVE_GET_D;
        static public bool REALLY_SAFE;
        static public bool ZONE_CONTROL_ZMP_ONLY;
        static public bool DESTROY_POSSESSIONS;
        static public bool LINK_TO_OBJECT;
        static public bool OWNER_QUEUES;
        static public bool WIZ_NOAENTER;
        static public bool FULL_INVIS;
        static public bool EMPTY_ATTRS;
        #endregion

        #region Attributes
        static public bool ADESTROY;
        static public bool AMAIL;
        static public bool PLAYER_LISTEN;
        static public bool PLAYER_AHEAR;
        static public bool STARTUPS;
        static public bool READ_REMOTE_DESC;
        #endregion

        #region Cosmetic Stuff
        static public bool ANSI_NAME;
        static public bool COMMA_EXIT_LIST;
        static public bool COUNT_ALL;
        static public bool EXITS_CONNECT_ROOMS;
        static public string WIZWALL_PREFIX;
        static public string RWALL_PREFIX;
        static public string WALL_PREFIX;
        static public bool ANNOUNCE_CONNECTS;
        static public bool PLAYER_NAME_SPACES;
        static public bool FLAGS_ON_EXAMINE;
        static public bool EX_PUBLIC_ATTRIBS;
        static public bool BLIND_PAGE;
        static public bool PAGE_ALIASES;
        static public bool CHAT_STRIP_QUOTE;
        static public bool NEWLINE_ONE_CHAR;
        static public bool ONLY_ASCII_IN_NAMES;
        #endregion

        #region Default Flags
        static public List<string> EXIT_FLAGS = new List<string>();
        static public List<string> ROOM_FLAGS = new List<string>();
        static public List<string> PLAYER_FLAGS = new List<string>();
        static public List<string> THING_FLAGS = new List<string>();
        static public List<string> CHANNEL_FLAGS = new List<string>();
        #endregion

        // We always need a starting point, so this should always be the
        // same.
        static string path = "mush.cnf";

        /// <summary>
        /// Load options from mush.cnf
        /// </summary>
        static public bool Load()
        {
            Console.WriteLine("Attempting to load mush.cnf...");
            if (File.Exists(path))
            {
                Console.WriteLine("Found mush.cnf!");
                StreamReader file = new StreamReader(path);
                string line;
                while ((line = file.ReadLine()) != null)
                {
                    ParseLine(line);
                }
                return true;
            }
            else
            {
                Error.Core("Could not find mush.cnf!");
                return false;
            }

        }

        /// <summary>
        /// Parse a string into a valid option format.
        /// </summary>
        /// <param name="line">String to be parsed</param>
        static private void ParseLine(string line)
        {
            if (line.StartsWith("#") || line.Trim() == "")
            {
                // Skip over comments and blank lines
                return;
            }
            else if (AssignValue(line))
            {
            }
            else
            {
                Error.Core("Unasignable Line: \"{0}\"");
            }
        }

        /// <summary>
        /// Iterate through all possible config options and assign correctly.
        /// </summary>
        /// <param name="line">String to be passed</param>
        /// <returns></returns>
        static private bool AssignValue(string line)
        {
            // Create new Option object to deal with handling of string
            // and returns in proper formats.
            Option op = new Option(line);

            switch (op.Name.ToUpper())
            {
                case "MUD_NAME":
                    MUD_NAME = op.GetString();
                    break;
                case "MUD_URL":
                    MUD_URL = op.GetString();
                    break;
                case "PORT":
                    PORT = op.GetInt();
                    break;
                case "IP_ADDR":
                    IP_ADDR = op.GetString();
                    break;
                case "USE_DNS":
                    USE_DNS = op.GetBool();
                    break;
                case "INPUT_DATABASE":
                    INPUT_DATABASE = op.GetPath();
                    break;
                case "OUTPUT_DATABASE":
                    OUTPUT_DATABASE = op.GetPath();
                    break;
                case "CRASH_DATABASE":
                    CRASH_DATABASE = op.GetPath();
                    break;
                case "MAIL_DATABASE":
                    MAIL_DATABASE = op.GetPath();
                    break;
                case "CHAT_DATABASE":
                    CHAT_DATABASE = op.GetPath();
                    break;
                case "PLAYER_START":
                    PLAYER_START = op.GetInt();
                    break;
                case "MASTER_ROOM":
                    MASTER_ROOM = op.GetInt();
                    break;
                case "BASE_ROOM":
                    BASE_ROOM = op.GetInt();
                    break;
                case "ANCESTOR_ROOM":
                    ANCESTOR_ROOM = op.GetInt();
                    break;
                case "ANCESTOR_EXIT":
                    ANCESTOR_EXIT = op.GetInt();
                    break;
                case "ANCESTOR_THING":
                    ANCESTOR_THING = op.GetInt();
                    break;
                case "ANCESTOR_PLAYER":
                    ANCESTOR_PLAYER = op.GetInt();
                    break;
                case "DEFAULT_HOME":
                    DEFAULT_HOME = op.GetInt();
                    break;
                case "ACCESS_FILE":
                    ACCESS_FILE = op.GetPath();
                    break;
                case "NAMES_FILE":
                    NAMES_FILE = op.GetPath();
                    break;
                case "MONEY_SINGULAR":
                    MONEY_SINGULAR = op.GetString();
                    break;
                case "MONEY_PLURAL":
                    MONEY_PLURAL = op.GetString();
                    break;
                case "IDLE_TIMEOUT":
                    IDLE_TIMEOUT = op.GetTime();
                    break;
                case "UNCONNECTED_IDLE_TIMEOUT":
                    UNCONNECTED_IDLE_TIMEOUT = op.GetTime();
                    break;
                case "KEEPALIVE_TIMEOUT":
                    KEEPALIVE_TIMEOUT = op.GetTime();
                    break;
                case "MAX_LOGINS":
                    MAX_LOGINS = op.GetInt();
                    break;
                case "GUEST_DBREF":
                    GUEST_DBREF = op.GetInt();
                    break;
                case "STARTING_MONEY":
                    STARTING_MONEY = op.GetInt();
                    break;
                case "PAYCHECK":
                    PAYCHECK = op.GetInt();
                    break;
                case "STARTING_QUOTA":
                    STARTING_QUOTA = op.GetInt();
                    break;
                case "PLAYER_QUEUE_LIMIT":
                    PLAYER_QUEUE_LIMIT = op.GetInt();
                    break;
                case "QUEUE_CHUNK":
                    QUEUE_CHUNK = op.GetInt();
                    break;
                case "ACTIVE_QUEUE_CHUNK":
                    ACTIVE_QUEUE_CHUNK = op.GetInt();
                    break;
                case "FUNCTION_RECURSION_LIMIT":
                    FUNCTION_RECURSION_LIMIT = op.GetInt();
                    break;
                case "FUNCTION_INVOCATION_LIMIT":
                    FUNCTION_INVOCATION_LIMIT = op.GetInt();
                    break;
                case "MAX_PLAYER_CHANS":
                    MAX_PLAYER_CHANS = op.GetInt();
                    break;
                case "MAX_PARENTS":
                    MAX_PARENTS = op.GetInt();
                    break;
                case "MAX_DEPTH":
                    MAX_DEPTH = op.GetInt();
                    break;
                case "CHAN_COST":
                    CHAN_COST = op.GetInt();
                    break;
                case "WHISPER_LOUDNESS":
                    WHISPER_LOUDNESS = op.GetInt();
                    break;
                case "MAX_DBREF":
                    MAX_DBREF = op.GetInt();
                    break;
                case "MAX_ATTRS_PER_OBJ":
                    MAX_ATTRS_PER_OBJ = op.GetInt();
                    break;
                case "MAIL_LIMIT":
                    MAIL_LIMIT = op.GetInt();
                    break;
                case "KILL_MIN_COST":
                    KILL_MIN_COST = op.GetInt();
                    break;
                case "KILL_DEFAULT_COST":
                    KILL_DEFAULT_COST = op.GetInt();
                    break;
                case "KILL_BONUS":
                    KILL_BONUS = op.GetInt();
                    break;
                case "FIND_COST":
                    FIND_COST = op.GetInt();
                    break;
                case "QUOTA_COST":
                    QUOTA_COST = op.GetInt();
                    break;
                case "QUEUE_COST":
                    QUEUE_COST = op.GetInt();
                    break;
                case "QUEUE_LOSS":
                    QUEUE_LOSS = op.GetInt();
                    break;
                case "ROOM_COST":
                    ROOM_COST = op.GetInt();
                    break;
                case "OBJECT_COST":
                    OBJECT_COST = op.GetInt();
                    break;
                case "LINK_COST":
                    LINK_COST = op.GetInt();
                    break;
                case "EXIT_COST":
                    EXIT_COST = op.GetInt();
                    break;
                case "PURGE_INTERVAL":
                    PURGE_INTERVAL = op.GetTime();
                    break;
                case "DBCK_INTERVAL":
                    DBCK_INTERVAL = op.GetTime();
                    break;
                case "WARN_INTERVAL":
                    WARN_INTERVAL = op.GetTime();
                    break;
                case "FLOAT_PRECISION":
                    FLOAT_PRECISION = op.GetInt();
                    break;
                case "LOG_WIPE_PASSWD":
                    LOG_WIPE_PASSWD = op.GetString();
                    break;
                case "PLAYER_NAME_LEN":
                    PLAYER_NAME_LEN = op.GetInt();
                    break;
                case "MAX_ALIASES":
                    MAX_ALIASES = op.GetInt();
                    break;
                case "USE_QUOTA":
                    USE_QUOTA = op.GetBool();
                    break;
                case "DUMP_INTERVAL":
                    DUMP_INTERVAL = op.GetTime();
                    break;
                case "FORKING_DUMP":
                    FORKING_DUMP = op.GetBool();
                    break;
                case "DUMP_WARNING_5MIN":
                    DUMP_WARNING_5MIN = op.GetString();
                    break;
                case "DUMP_WARNING_1MIN":
                    DUMP_WARNING_1MIN = op.GetString();
                    break;
                case "DUMP_MESSAGE":
                    DUMP_MESSAGE = op.GetString();
                    break;
                case "DUMP_COMPLETE":
                    DUMP_COMPLETE = op.GetString();
                    break;
                case "CONNECT_FILE":
                    CONNECT_FILE = op.GetPath();
                    break;
                case "MOTD_FILE":
                    MOTD_FILE = op.GetPath();
                    break;
                case "WIZMOTD_FILE":
                    WIZMOTD_FILE = op.GetPath();
                    break;
                case "QUIT_FILE":
                    QUIT_FILE = op.GetPath();
                    break;
                case "NEWUSER_FILE":
                    NEWUSER_FILE = op.GetPath();
                    break;
                case "DOWN_FILE":
                    DOWN_FILE = op.GetPath();
                    break;
                case "REGISTER_CREATE_FILE":
                    REGISTER_CREATE_FILE = op.GetPath();
                    break;
                case "GUEST_FILE":
                    GUEST_FILE = op.GetPath();
                    break;
                case "FULL_FILE":
                    FULL_FILE = op.GetPath();
                    break;
                case "HELP_COMMAND":
                    HELP_COMMANDS.Add(op.Values[0], op.Values[1]);
                    break;
                case "ERROR_LOG":
                    ERROR_LOG = op.GetPath();
                    break;
                case "CONNECT_LOG":
                    CONNECT_LOG = op.GetPath();
                    break;
                case "WIZARD_LOG":
                    WIZARD_LOG = op.GetPath();
                    break;
                case "CHECKPT_LOG":
                    CHECKPT_LOG = op.GetPath();
                    break;
                case "TRACE_LOG":
                    TRACE_LOG = op.GetPath();
                    break;
                case "COMMAND_LOG":
                    COMMAND_LOG = op.GetPath();
                    break;
                case "LOG_COMMANDS":
                    LOG_COMMANDS = op.GetBool();
                    break;
                case "LOG_FORCES":
                    LOG_FORCES = op.GetBool();
                    break;
                case "LOGINS":
                    LOGINS = op.GetBool();
                    break;
                case "GUESTS":
                    GUESTS = op.GetBool();
                    break;
                case "PLAYER_CREATION":
                    PLAYER_CREATION = op.GetBool();
                    break;
                case "REVERSE_SHS":
                    REVERSE_SHS = op.GetBool();
                    break;
                case "ROOM_CONNECTS":
                    ROOM_CONNECTS = op.GetBool();
                    break;
                case "SAFER_UFUN":
                    SAFER_UFUN = op.GetBool();
                    break;
                case "FUNCTION_SIDE_EFFECTS":
                    FUNCTION_SIDE_EFFECTS = op.GetBool();
                    break;
                case "NOISY_WHISPER":
                    NOISY_WHISPER = op.GetBool();
                    break;
                case "NOISY_CEMIT":
                    NOISY_CEMIT = op.GetBool();
                    break;
                case "POSSESSIVE_GET":
                    POSSESSIVE_GET = op.GetBool();
                    break;
                case "POSSESSIVE_GET_D":
                    POSSESSIVE_GET_D = op.GetBool();
                    break;
                case "REALLY_SAFE":
                    REALLY_SAFE = op.GetBool();
                    break;
                case "ZONE_CONTROL_ZMP_ONLY":
                    ZONE_CONTROL_ZMP_ONLY = op.GetBool();
                    break;
                case "DESTROY_POSSESSIONS":
                    DESTROY_POSSESSIONS = op.GetBool();
                    break;
                case "LINK_TO_OBJECT":
                    LINK_TO_OBJECT = op.GetBool();
                    break;
                case "OWNER_QUEUES":
                    OWNER_QUEUES = op.GetBool();
                    break;
                case "WIZ_NOAENTER":
                    WIZ_NOAENTER = op.GetBool();
                    break;
                case "FULL_INVIS":
                    FULL_INVIS = op.GetBool();
                    break;
                case "EMPTY_ATTRS":
                    EMPTY_ATTRS = op.GetBool();
                    break;
                case "ADESTROY":
                    ADESTROY = op.GetBool();
                    break;
                case "AMAIL":
                    AMAIL = op.GetBool();
                    break;
                case "PLAYER_LISTEN":
                    PLAYER_LISTEN = op.GetBool();
                    break;
                case "PLAYER_AHEAR":
                    PLAYER_AHEAR = op.GetBool();
                    break;
                case "STARTUPS":
                    STARTUPS = op.GetBool();
                    break;
                case "READ_REMOTE_DESC":
                    READ_REMOTE_DESC = op.GetBool();
                    break;
                case "ANSI_NAME":
                    ANSI_NAME = op.GetBool();
                    break;
                case "COMMA_EXIT_LIST":
                    COMMA_EXIT_LIST = op.GetBool();
                    break;
                case "COUNT_ALL":
                    COUNT_ALL = op.GetBool();
                    break;
                case "EXITS_CONNECT_ROOMS":
                    EXITS_CONNECT_ROOMS = op.GetBool();
                    break;
                case "WIZWALL_PREFIX":
                    WIZWALL_PREFIX = op.GetString();
                    break;
                case "RWALL_PREFIX":
                    RWALL_PREFIX = op.GetString();
                    break;
                case "WALL_PREFIX":
                    WALL_PREFIX = op.GetString();
                    break;
                case "ANNOUNCE_CONNECTS":
                    ANNOUNCE_CONNECTS = op.GetBool();
                    break;
                case "PLAYER_NAME_SPACES":
                    PLAYER_NAME_SPACES = op.GetBool();
                    break;
                case "FLAGS_ON_EXAMINE":
                    FLAGS_ON_EXAMINE = op.GetBool();
                    break;
                case "EX_PUBLIC_ATTRIBS":
                    EX_PUBLIC_ATTRIBS = op.GetBool();
                    break;
                case "BLIND_PAGE":
                    BLIND_PAGE = op.GetBool();
                    break;
                case "PAGE_ALIASES":
                    PAGE_ALIASES = op.GetBool();
                    break;
                case "CHAT_STRIP_QUOTE":
                    CHAT_STRIP_QUOTE = op.GetBool();
                    break;
                case "NEWLINE_ONE_CHAR":
                    NEWLINE_ONE_CHAR = op.GetBool();
                    break;
                case "ONLY_ASCII_IN_NAMES":
                    ONLY_ASCII_IN_NAMES = op.GetBool();
                    break;
                case "EXIT_FLAGS":
                    if (op.Values.Length > 1)
                    {
                        for (int i = 0; i < op.Values.Length; i++)
                        {
                            EXIT_FLAGS.Add(op.Values[i]);
                        }
                    }
                    break;
                case "ROOM_FLAGS":
                    if (op.Values.Length > 1)
                    {
                        for (int i = 0; i < op.Values.Length; i++)
                        {
                            ROOM_FLAGS.Add(op.Values[i]);
                        }
                    }
                    break;
                case "PLAYER_FLAGS":
                    if (op.Values.Length > 1)
                    {
                        for (int i = 0; i < op.Values.Length; i++)
                        {
                            PLAYER_FLAGS.Add(op.Values[i]);
                        }
                    }
                    break;
                case "THING_FLAGS":
                    if (op.Values.Length > 1)
                    {
                        for (int i = 0; i < op.Values.Length; i++)
                        {
                            THING_FLAGS.Add(op.Values[i]);
                        }
                    }
                    break;
                case "CHANNEL_FLAGS":
                    if (op.Values.Length > 1)
                    {
                        for (int i = 0; i < op.Values.Length; i++)
                        {
                            CHANNEL_FLAGS.Add(op.Values[i]);
                        }
                    }
                    break;
                default:
                    Console.WriteLine("Boom!: {0} - {1}", op.Name, op.GetString());
                    return false;

            }
            Console.WriteLine("--> {0} : {1}", op.Name, op.GetString());
            return true;
        }
    }
    
}